package cn.edu.tju.wallet.dto;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Positive;
import java.math.BigDecimal;

/**
 * 支付请求DTO
 */
public class PaymentRequestDTO {
    @NotNull(message = "付款方ID不能为空")
    @Positive(message = "付款方ID必须大于0")
    private Long payerId;

    @NotNull(message = "收款方ID不能为空")
    @Positive(message = "收款方ID必须大于0")
    private Long receiverId;

    @NotNull(message = "支付金额不能为空")
    @Positive(message = "支付金额必须大于0")
    private BigDecimal amount;

    @NotNull(message = "订单ID不能为空")
    @Positive(message = "订单ID必须大于0")
    private Long orderId;

    /**
     * 是否允许使用透支支付
     * true: 余额不足时允许使用透支额度
     * false: 余额不足时支付失败
     */
    private Boolean allowOverdraft = false;

    // Getter和Setter
    public Long getPayerId() { return payerId; }
    public void setPayerId(Long payerId) { this.payerId = payerId; }
    public Long getReceiverId() { return receiverId; }
    public void setReceiverId(Long receiverId) { this.receiverId = receiverId; }
    public BigDecimal getAmount() { return amount; }
    public void setAmount(BigDecimal amount) { this.amount = amount; }
    public Long getOrderId() { return orderId; }
    public void setOrderId(Long orderId) { this.orderId = orderId; }
    public Boolean getAllowOverdraft() { return allowOverdraft; }
    public void setAllowOverdraft(Boolean allowOverdraft) { this.allowOverdraft = allowOverdraft; }
}
